﻿<Fluent:RibbonWindow x:Class="SGT.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
    xmlns:s="http://www.stemasoft.com/xaml"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:local="clr-namespace:SGT"
    xmlns:local2="clr-namespace:SGT.ViewModel"
   
    xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
    xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
    xmlns:System_Windows_Controls_DataVisualization_Charting_Primitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit" mc:Ignorable="d" 
    xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
    xmlns:TK="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"                     
                     
                     
    Title="Sistema de gestión de movimientos"
    Background="{Binding Background, ElementName=navigationPaneExpander}" ResizeMode="CanResizeWithGrip" >

    
    

    <Fluent:RibbonWindow.Resources>
        

        <Style x:Key="ClearButan" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Name="border"
                     Padding="4"
                     Background="transparent">
                            <Grid >
                                <ContentPresenter HorizontalAlignment="Center"
                                    VerticalAlignment="Center">
                                </ContentPresenter>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        
        
        <!-- <DataTemplate x:Key="DataTemplate1">
            <DVC:Chart Title="{Binding Titulo}" Canvas.Top="1" />

        </DataTemplate>
-->

        <s:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter1"/>
        <s:BooleanNegateConverter x:Key="BooleanNegateConverter"/>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    </Fluent:RibbonWindow.Resources>
    
    
    <DockPanel LastChildFill="True">
        <Fluent:Ribbon DockPanel.Dock="Top">
            <!--Quick Access Toolbar Items-->
            <Fluent:Ribbon.QuickAccessItems>
                <Fluent:QuickAccessMenuItem Target="{Binding ElementName=buttonGreen}"/>
            </Fluent:Ribbon.QuickAccessItems>

            <!--Tabs-->
            
            <Fluent:RibbonTabItem Header="Remitos" ReduceOrder="(P),(P),(P),(P),(P)" x:Name="RemitosTab" >
                <Fluent:RibbonGroupBox Header="" HorizontalContentAlignment="Center" HorizontalAlignment="Center">
                    <Fluent:Button LargeIcon="Img\Agregar.png"  Header="Nuevo"  Command="{Binding IrANuevoRemitoEntrada}" />
                </Fluent:RibbonGroupBox>
                
                

            </Fluent:RibbonTabItem>

            <Fluent:RibbonTabItem Header="Depositos" >
                <Fluent:RibbonGroupBox x:Name="ABM_Depositos" >
                    <Fluent:Button LargeIcon="/SGT;component/Img/Editar32x32.png"  Header="Establecer deposito actual" Command="{Binding EstablecerDepositoActual}" />
                    <Fluent:Button LargeIcon="/SGT;component/Img/Nuevo32x32.png"  Header="Nuevo deposito" Command="{Binding NuevoDeposito}" />
                </Fluent:RibbonGroupBox>
            </Fluent:RibbonTabItem>

            <Fluent:RibbonTabItem Header="Proveedores" >
                <Fluent:RibbonGroupBox x:Name="ABM_Proveedores">
                    <Fluent:Button LargeIcon="/SGT;component/Img/Nuevo.png"  Header="Nuevo proveedor" Command="{Binding AgregarProveedor}" />
                </Fluent:RibbonGroupBox>
             </Fluent:RibbonTabItem>

            <Fluent:RibbonTabItem Header="Mercaderias" >
                <Fluent:RibbonGroupBox x:Name="ABM_Mercaderia">
                    <Fluent:Button LargeIcon="/SGT;component/Img/Arroz.png" Header="Ver mercaderias" />
                    <Fluent:Button LargeIcon="/SGT;component/Img/Nuevo.png"  Header="Nueva mercaderia" Command="{Binding AgregarMercaderia}" />
                    <Fluent:Button LargeIcon="/SGT;component/Img/Editar.png" Header="Editar mercaderia" />
                    
                </Fluent:RibbonGroupBox>
                
            </Fluent:RibbonTabItem>

            
            
            <!--Backstage Items-->
            <Fluent:Ribbon.Menu>
                <Fluent:Backstage>
                    <Fluent:BackstageTabControl>
                        <Fluent:Button Header="Close" Command="{Binding ExitCommand}" Icon="Img\Blue.png"/>
                    </Fluent:BackstageTabControl>
                </Fluent:Backstage>
            </Fluent:Ribbon.Menu>
        </Fluent:Ribbon>
        <Fluent:StatusBar VerticalAlignment="Bottom" d:LayoutOverrides="Height" DockPanel.Dock="Bottom" />
        <s:NavigationPane x:Name="navigationPane" SelectedIndex="0" LargeItems="4" Margin="2,0,0,1" Width="160" >
            <s:NavigationPane.BarTitle>
                <TextBlock Text="Navigation Pane" FontWeight="Bold" FontSize="14.667"/>
            </s:NavigationPane.BarTitle>
            <s:NavigationPaneItem Header="Remitos" Image="Img/Ver_Remitos32x32.png" >
                
                <StackPanel >
                    <TreeView ItemsSource="{Binding PrimeraGeneracion}" Background="{x:Null}" BorderBrush="{x:Null}">
                        <TreeView.ItemContainerStyle>
                            <!-- 
        This Style binds a TreeViewItem to a PersonViewModel. 
        -->
                            <Style TargetType="{x:Type TreeViewItem}">
                                <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
                                <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
                                <Setter Property="FontWeight" Value="Normal" />
                                <Style.Triggers>
                                    <Trigger Property="IsSelected" Value="True">
                                        <Setter Property="FontWeight" Value="Bold" />
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </TreeView.ItemContainerStyle>
                        <TreeView.Resources>
                            <HierarchicalDataTemplate 
                              DataType="{x:Type local2:ASectorViewModel}" 
                              ItemsSource="{Binding Children}"
                              >
                                <StackPanel Orientation="Horizontal">
                                    <Image Width="16" Height="16" Margin="3,0" Source="{Binding Imagen}"/>
                                    <TextBlock Text="{Binding Name}" />
                                </StackPanel>
                            </HierarchicalDataTemplate>
                        </TreeView.Resources>

                        <!-- <TreeView.ItemTemplate>
                            <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                                <TextBlock Text="{Binding Name}" />
                            </HierarchicalDataTemplate>
                        </TreeView.ItemTemplate> -->
                    </TreeView>

                </StackPanel>

            </s:NavigationPaneItem>
            <s:NavigationPaneItem Header="Proveedores" Image="Img/Proveedores32x32.png">
                <StackPanel Background="White">
                    <TreeView Background="{x:Null}">
                        <TreeViewItem Header="Proveedores" IsExpanded ="True">
                            <Button Style="{StaticResource ClearButan}" Content="Todos" Command="{Binding IrAVerProveedores}"/>
                        </TreeViewItem>
                    </TreeView>

                </StackPanel>
            </s:NavigationPaneItem>
            <s:NavigationPaneItem Header="Depositos" Image="Img/Home.png">
                <StackPanel Background="White">
                    <TreeView Background="{x:Null}">
                        <TreeViewItem Header="Depositos" IsExpanded ="True">
                            <Button Style="{StaticResource ClearButan}" Content="Todos" Command="{Binding IrAVerDepositos}"/>
                        </TreeViewItem>
                    </TreeView>

                </StackPanel>
            </s:NavigationPaneItem>
            <s:NavigationPaneItem Header="Mercaderias" Image="Img/Arroz35x35.png">
            </s:NavigationPaneItem>
        </s:NavigationPane>
        <s:NavigationPaneExpander x:Name="navigationPaneExpander" Orientation="Right" CloseButtonClick="navigationPaneExpander_CloseButtonClick" DockPanel.Dock="Right" Margin="0,0,2,1" Width="200" >
            <s:NavigationPaneExpander.Header>
                <TextBlock Foreground="Red" Text="aaaaa"/>
            </s:NavigationPaneExpander.Header>
            <Grid x:Name="CanResizeContent" s:NavigationPaneExpander.CanResize="False" >
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto" >
                    <DVC:Chart Title="{Binding GraficaSelcionada.Titulo}"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" LegendStyle="{StaticResource LegendStyle}" Grid.Row="1">
                        <DVC:ColumnSeries  DependentValueBinding="{Binding UsoActual}" IndependentValueBinding="{Binding TipoMercaderia.Nombre}" ItemsSource="{Binding GraficaSelcionada.ListaSectores}">
                            <DVC:ColumnSeries.Effect>
                                <DropShadowEffect/>
                            </DVC:ColumnSeries.Effect>
                            <DVC:ColumnSeries.DependentRangeAxis>
                                <DVC:LinearAxis 
                        Orientation="Y"
                        Minimum="0"
                        Maximum="{Binding GraficaSelcionada.MaxRango}"
                        ShowGridLines="True" DataContext="{Binding GraficaSelcionada.ListaSectores}" MajorTickMarkStyle="{Binding}" />
                            </DVC:ColumnSeries.DependentRangeAxis>

                        </DVC:ColumnSeries>

                    </DVC:Chart>
                </ScrollViewer>
                

            </Grid>
       
        </s:NavigationPaneExpander>
        <Border BorderBrush="{Binding BorderBrush, ElementName=navigationPane}" BorderThickness="1" Background="White" Padding="6" Margin="2,2,4,4">
            <Border.Effect>
                <DropShadowEffect BlurRadius="4" ShadowDepth="0" Opacity="0.3" Color="#AC000000"/>
            </Border.Effect>
            <Frame  x:Name="frame1" NavigationUIVisibility="Hidden" Source="{Binding ContenidoPagina}" IsManipulationEnabled="True" />
        </Border>

    </DockPanel>

</Fluent:RibbonWindow>
